<template>
	<view>
		<!-- 搜索框 -->
		<view class="input-box">
			<image src="../../../static/index/search.png" mode=""></image>
			<input class="input-text" type="text" placeholder="请输入关键字" placeholder-style="color:#999;font-size:22rpx;" />
		</view>
		<!-- 分类标题 -->
		<view class="item">
			<view class="item-list" :class="{'style':show==0}" @click="check(0)">社区养老</view>
			<view class="item-list" :class="{'style':show==1}" @click="check(1)">基地养老</view>
			<view class="item-list" :class="{'style':show==2}" @click="check(2)">居家养老</view>
			<view class="item-list" :class="{'style':show==3}" @click="check(3)">旅居养老</view>
		</view>
		<!-- 推荐栏和地址 -->
		<view class="recommend">
			<view class="left">推荐</view>
			<view class="middle distance" v-if="show==0 || show==1">附近</view>
			<view class="middle distance" v-if="show==3">省内</view>
			<view class="middle distance" v-if="show==3">国内</view>
			<view class="middle distance" v-if="show==3">国外</view>
			<view class="right" v-if="show==0 || show==1 || show==3">
				<text>合肥市包河区</text>
				<u-icon name="arrow-down" color="#909090" size="20"></u-icon>
			</view>
		</view>
		<!-- 社区养老 -->
		<view class="community" v-if="show==0">
			<view class="community-item" @click="navTo">
				<image src="../../../static/enterprise/item.png" mode=""></image>
				<view>
					<view class="title">方兴社区养老</view>
					<view class="space">距离您100米；包河区工业园区</view>
					<view class="price">￥188</view>
				</view>
			</view>
			<view class="community-item">
				<image src="../../../static/enterprise/item.png" mode=""></image>
				<view>
					<view class="title">方兴社区养老</view>
					<view class="space">距离您100米；包河区工业园区</view>
					<view class="price">￥188</view>
				</view>
			</view>
		</view>
		<!-- 基地养老 -->
		<view class="community" v-if="show==1">
			<view class="community-item">
				<image src="../../../static/enterprise/item.png" mode=""></image>
				<view>
					<view class="title">方兴社区养老</view>
					<view class="space">距离您100米；包河区工业园区</view>
					<view class="price">￥188</view>
				</view>
			</view>
			<view class="community-item">
				<image src="../../../static/enterprise/item.png" mode=""></image>
				<view>
					<view class="title">方兴社区养老</view>
					<view class="space">距离您100米；包河区工业园区</view>
					<view class="price">￥188</view>
				</view>
			</view>
		</view>
		<!-- 居家养老 -->
		<view class="home" v-if="show==2">
			<view class="home-item">
				<image src="../../../static/mall/goods.png" mode=""></image>
				<view class="home-name">爱牵挂长者智护手表X1</view>
				<view class="home-price">￥188</view>
			</view>
			<view class="home-item">
				<image src="../../../static/mall/goods.png" mode=""></image>
				<view class="home-name">爱牵挂长者智护手表X1</view>
				<view class="home-price">￥188</view>
			</view>
			<view class="home-item">
				<image src="../../../static/mall/goods.png" mode=""></image>
				<view class="home-name">爱牵挂长者智护手表X1</view>
				<view class="home-price">￥188</view>
			</view>
		</view>
		<!-- 旅居养老 -->
		<view class="home" v-if="show==3">
			<view class="home-item">
				<image src="../../../static/mall/goods.png" mode=""></image>
				<view class="home-name">爱牵挂长者智护手表X1</view>
				<view class="home-price">￥188</view>
			</view>
			<view class="home-item">
				<image src="../../../static/mall/goods.png" mode=""></image>
				<view class="home-name">爱牵挂长者智护手表X1</view>
				<view class="home-price">￥188</view>
			</view>
			<view class="home-item">
				<image src="../../../static/mall/goods.png" mode=""></image>
				<view class="home-name">爱牵挂长者智护手表X1</view>
				<view class="home-price">￥188</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				show:0
			}
		},
		methods:{
			check(e){
				this.show=e
			},
			navTo(){
				uni.navigateTo({
					url:'./pensionDetail'
				})
			}
		}
	}
</script>

<style lang="less">
	.input-box{
		display: flex;
		align-items: center;
		width: 690rpx;
		height: 50rpx;
		border: 1px solid #F09238;
		border-radius: 29rpx;
		margin: 10rpx 30rpx;
		padding-left: 20rpx;
		image{
			width: 20rpx;
			height: 20rpx;
			margin-right: 10rpx;
		}
	}
	.item{
		width: 690rpx;
		margin: 50rpx 30rpx 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.item-list{
		width: 150rpx;
		height: 66rpx;
		border: 1px solid #FF9B3C;
		border-radius: 33rpx;
		line-height: 66rpx;
		text-align: center;
		color: #FF9B3C;
		font-size: 24rpx;
		font-weight: 300;
	}
	.style{
		background: #FF9B3C;
		box-shadow: 0rpx 3rpx 10rpx rgba(255, 155, 60, 0.58);
		font-weight: bold;
		color: #FFFFFF;
		font-size: 28rpx;
	}
	.recommend{
		width: 750rpx;
		display: flex;
		align-items: center;
		border-bottom: 1px solid #ECECEC;
		padding: 0 30rpx 10rpx 30rpx;
	}
	.left{
		font-size: 28rpx;
		color: #F09238;
	}
	.middle{
		font-size: 24rpx;
		color: #999999;
	}
	.right{
		font-size: 24rpx;
		color: #999999;
		position: absolute;
		right: 30rpx;
		text{
			margin-right: 10rpx;
		}
	}
	.distance{
		margin-left: 40rpx;
	}
	.community{
		width: 750rpx;
		padding: 0 30rpx;
		margin-top: 40rpx;
	}
	.community-item{
		display: flex;
		align-items: center;
		width: 690rpx;
		height: 266rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 4rpx 20rpx rgba(0, 0, 0, 0.16);
		border-radius: 12rpx;
		padding: 30rpx 0 30rpx 30rpx;
		margin-bottom: 30rpx;
		image{
			width: 282rpx;
			height: 206rpx;
			margin-right: 20rpx;
		}
	}
	.title{
		font-size: 30rpx;
		font-weight: bold;
		color: #333333;
		margin-bottom: 20rpx;
	}
	.space{
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		margin-bottom: 10rpx;
	}
	.price{
		font-size: 30rpx;
		font-weight: bold;
		color: #F0812D;
	}
	.home{
		width: 750rpx;
		margin-top: 40rpx;
		display: flex;
		flex-wrap: wrap;
	}
	.home-item{
		width: 330rpx;
		height: 438rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 4rpx 20rpx rgba(4, 0, 0, 0.08);
		border-radius: 14rpx;
		margin-left: 30rpx;
		margin-bottom: 30rpx;
		image{
			width: 330rpx;
			height: 306rpx;
			margin-bottom: 20rpx;
		}
		.home-name{
			font-size: 26rpx;
			color: #000000;
			margin-left: 20rpx;
			margin-bottom: 10rpx;
			text-overflow: ellipsis;
			overflow: hidden;
			white-space: nowrap;
		}
		.home-price{
			font-size: 30rpx;
			font-weight: bold;
			color: #F0812D;
			margin-left: 20rpx;
		}
		
	}
</style>
